import { isNumber, isNaN } from 'lodash'

export function fen2yuan(nub: number) {
  if (isNumber(nub) && !isNaN(nub)) {
    return nub / 100
  }
  throw new Error(nub + '不是数字')
}

export function yuan2fen(nub: number) {
  if (isNumber(nub) && !isNaN(nub)) {
    return nub * 100
  }
  throw new Error(nub + '不是数字')
}
